package com.fh.practice.mapper;

import com.fh.practice.entity.Area;
import com.fh.practice.entity.User;
import com.fh.practice.entity.UserVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
 * 描述:
 * Author:袁亚强
 * Date:2022/1/2413:52
 */
@Mapper
public interface UserMapper {
    @Select("select * from t_job_user where name=#{name}")
    User queryByName(String name);

    int addUser(User user);

    @Select("select * from t_area ")
    List<Area> queryAllArea();

    @Select("select * from t_job_user where id =#{id}")
    User queryPasswordById(User user);

    @Update(" update t_job_user set password=#{password} where id =#{id}")
    void updatePassword(User user);

    long queryCount(UserVo userVo);

    List<User> queryUserVo(UserVo userVo);
    @Update("update t_job_user set areaid=#{areaid},hobbys=#{hobbys},sex=#{sex} where id=#{id}")
    void updateUserById(User user);
}
